//
//  LFIntroduceViewController.m
//  loanForYou
//
//  Created by 刘威 on 2017/9/1.
//  Copyright © 2017年 刘威. All rights reserved.
//

#import "LFIntroduceViewController.h"

@interface LFIntroduceViewController ()

@end

@implementation LFIntroduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor grayBackgroundColor];
    [self createNavigationBackItem];
    self.title = _ftitle;
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.image = [UIImage imageNamed:@"logo"];
    [self.view addSubview:imageView];
    [imageView makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.centerX);
        make.top.equalTo(self.view.top).offset(40);
        make.size.mas_equalTo(CGSizeMake(120, 120));
    }];
    imageView.layer.masksToBounds = YES;
    imageView.layer.cornerRadius = 5;
    
    UILabel *contentLabel = [[UILabel alloc] init];
    contentLabel.text = _content;
    contentLabel.numberOfLines = 0;
    contentLabel.font = [UIFont contentFont];
    contentLabel.textColor = [UIColor contentColor];
    [self.view addSubview:contentLabel];
    
    if (_haveLogo) {
        [contentLabel makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(imageView.bottom).offset(30);
            make.left.equalTo(self.view.left).offset(30);
            make.right.equalTo(self.view.right).offset(-30);
        }];
    } else {
        imageView.hidden = YES;
        [contentLabel makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.view.top).offset(30);
            make.left.equalTo(self.view.left).offset(30);
            make.right.equalTo(self.view.right).offset(-30);
        }];
    }
    // Do any additional setup after loading the view.
}

- (void)setHaveLogo:(BOOL)haveLogo {
    _haveLogo = haveLogo;
}

- (void)setFtitle:(NSString *)ftitle {
    _ftitle = ftitle;
}

- (void)setContent:(NSString *)content {
    _content = content;
}

- (void)actionBack:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
